package com.cjl.demo.string;

import java.util.Arrays;
import java.util.StringJoiner;

public class StringJoinerTest {
    public static void main(String[] args) {
        StringJoiner sj1 = new StringJoiner(",");
        StringJoiner sj2 = new StringJoiner(".", "[","]");
        sj1.add("a").add("b").add("c");
        System.out.println("sj1= " + sj1);
        sj2.add("d").add("e").add("f");
        System.out.println("sj2 = " + sj2);
        System.out.println("sj1.merge(sj2) = " + sj1.merge(sj2));
        System.out.println("sj2.merge(sj1) = " + sj2.merge(sj1));


    }
}
